<div class="page_head">
<h2><%="Editing message".t%></h2>
</div>

<%= error_messages_for :message %>

<% form_for(:message, :url => message_path(@message.project,@message), :html => { :method => :put }) do |f| %>
<div class="FormBlock">
    <b><%="Title".t%>:</b><br />
    <%= f.text_field :name ,:class=>'big_font'%></br>
    <strong><%="Category".t%>:</strong>
    <span id='cat_show'>
    <%=render :partial=>'categories/cat_show',:locals=>{:cats=>@cats,:cur_cat=>@message.category_id,:label=>'msg'}%>
    </span>
    <span class="private_label"><%="Private".t%><%=f.check_box :private%></span>
    <%=f.hidden_field :body%>
    <%=fckeditor_text"message_body",'message'%>
    <script>
    //window.onload=function(){
    //var oEditor = FCKeditorAPI.GetInstance('message[body]');
    //oEditor.SetHTML('<%=@message.body%>');
   // }
    </script>
    <hr>
    <%= submit_tag "Save this message".t %>
    or <%=link_to "Cancel".t,"javascript:history.back()",:class=>'admin'%>
  </div>
<% end %>
